UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H96ZvqRhgAnKKzDXvgD5vJ5InWqOiPg1NarIH1tcGDg='
WHERE
key_id = '22c5dcae5b0224b1903633fa11f6efc89547ff1eda2745216c14f5138a9d0edf'
AND (
token = 'H96ZvqRhgAnKKzDXvgD5vJ5InWqOiPg1NarIH1tcGDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)