UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1RrCFF5kbqTppkV1Tza99jjkrMrRIsnn/1dAqEMm+Zs='
WHERE
key_id = 'd0e2551bf4f1aee693613a75c97ad3ff88006bed66548d7157dbf7edd465ce77'
AND (
token = '1RrCFF5kbqTppkV1Tza99jjkrMrRIsnn/1dAqEMm+Zs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)