UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '524Lv3jvpAOdsleMECHrSYJk5R9Ot7/KkraaVgKMBl4='
WHERE
key_id = 'aab57c336268e79f9dc16e732d94a65845b1046a06c20e89713aa358316d937f'
AND (
token = '524Lv3jvpAOdsleMECHrSYJk5R9Ot7/KkraaVgKMBl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)