UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uxiiiwswI9PRH113EqYe0GUKCM6xHL/j+b3ObcV8WzI='
WHERE
key_id = '38461b699b174442bf39ea597885ebc06dea1612a1aee95f6c6f5862eaf63b7f'
AND (
token = 'uxiiiwswI9PRH113EqYe0GUKCM6xHL/j+b3ObcV8WzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)