UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ucr9Yg65bCfAO+u12v0nhpMvf56/EyqrA1c65nrK8Og='
WHERE
key_id = '9e6f0f1fbad8f6c6b6ec6a034b7a338a9fde3d3a35df68b3e0e0a8fe41406b3a'
AND (
token = 'Ucr9Yg65bCfAO+u12v0nhpMvf56/EyqrA1c65nrK8Og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)