UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XWQAsQgK0lKmF35A/fd/wKvfX+uYk386yCmdWSjSNQk='
WHERE
key_id = '3daf5d219c79f314dbf4d3133e7af20007f53791094343f5c5b009f792a37773'
AND (
token = 'XWQAsQgK0lKmF35A/fd/wKvfX+uYk386yCmdWSjSNQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)