UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZDqzCeMiS4nrO2V3aY2BXycC5FRqTw/WEUqyw6D00s='
WHERE
key_id = 'fbed1efc9639aa7f6eb0bb716e8e688ef038e481e13e7eeac53002148a87f1e1'
AND (
token = 'WZDqzCeMiS4nrO2V3aY2BXycC5FRqTw/WEUqyw6D00s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)