UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x2+B8NtPzOlAR1MWpQWf47vFg6E1uyF3exelYRqnk6w='
WHERE
key_id = '12e0fc1bd121542526b0f96c8c12a6d5482772b0a3052da1b5e1711d2001b7f8'
AND (
token = 'x2+B8NtPzOlAR1MWpQWf47vFg6E1uyF3exelYRqnk6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)