UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u9iXqgf7d/h+UYJHkffn1QTNWSvdccS83G8ambfW57k='
WHERE
key_id = '53c49895fa338fb76b78b1b890fa371e8fc93ba6b9d9a9247c77d6b4df57a93d'
AND (
token = 'u9iXqgf7d/h+UYJHkffn1QTNWSvdccS83G8ambfW57k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)