UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YFHYbcwuPXxAR0uTfFgkafC+gY7pjNTUuj5a55h4bFc='
WHERE
key_id = 'f5edef3cd6b205eb91ce6adca220b8bfb265f5e50c19224dca6ba78bffab1a69'
AND (
token = 'YFHYbcwuPXxAR0uTfFgkafC+gY7pjNTUuj5a55h4bFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)