UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBRYTCAFmeKxbyex0mp9QMDODTEIJN2cNnROsniTqYg='
WHERE
key_id = '7aaa9184942fe911ce333cbd5cd678ae14dd2b5be383b7923315474ddd4fa0ea'
AND (
token = 'VBRYTCAFmeKxbyex0mp9QMDODTEIJN2cNnROsniTqYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)