UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EiqppEXzAwROZDlX0jbnlSAqAJ8QK2UWuqHXJICBZJw='
WHERE
key_id = 'fa7aeb761e83b7cad83454c77efad6332b28ee5bbff92153ff1f6cde122fbd0f'
AND (
token = 'EiqppEXzAwROZDlX0jbnlSAqAJ8QK2UWuqHXJICBZJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)