UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5aINKZKPzP/LdtVOp1P487luHaBdts0lYbI1ujtSW7Q='
WHERE
key_id = '7a273bdcdebbdb5d737c18fed99b56679b7f8a2dc82e2cf06d753e7b3bcbe58e'
AND (
token = '5aINKZKPzP/LdtVOp1P487luHaBdts0lYbI1ujtSW7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)