UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fh4voz1d87YIdECQtOUVLOTrk8iRKdDiPVtxoYFyZ3s='
WHERE
key_id = 'af89d0919901c66c8ea5eafad5df5caf0f6156699c0ffee3b26f4b118f705876'
AND (
token = 'Fh4voz1d87YIdECQtOUVLOTrk8iRKdDiPVtxoYFyZ3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)