UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sKJb2u6LLKKPy1kNDVgwQSKlK/a1f1FjuOp4ebR8qTo='
WHERE
key_id = 'a6c5d3e562ab944482cbf37a9a05391806133086d488765cec66b77404de3a30'
AND (
token = 'sKJb2u6LLKKPy1kNDVgwQSKlK/a1f1FjuOp4ebR8qTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)