UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '42JY5qY+dI4z8UxC+SI2kTeDO1JnvyJIppJRFBJpRYg='
WHERE
key_id = '92e809347126f593d40964979290d248136b578a570c8e7adc6304aace2162f8'
AND (
token = '42JY5qY+dI4z8UxC+SI2kTeDO1JnvyJIppJRFBJpRYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)