UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/N6TrqoUcVBklxpO/D5kQZ6Q+hXFFJYLj2iXhaALaWw='
WHERE
key_id = '89535126666582a96126402259be75c7abe6b3c35d8e302a2b2f030dfecdec55'
AND (
token = '/N6TrqoUcVBklxpO/D5kQZ6Q+hXFFJYLj2iXhaALaWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)