UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9q2yX2tQwouX0Q8PBBnsvKVR3eLy9N4mte/AvQloMFk='
WHERE
key_id = '758e4f604cc9192279d377f5ce873905325c527a44065c7d5f958a9b65ac5be3'
AND (
token = '9q2yX2tQwouX0Q8PBBnsvKVR3eLy9N4mte/AvQloMFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)