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