UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'scju6znwE7M+k9rfe4zuvVx1ISF5g5663hF89rD8n0M='
WHERE
key_id = '190df4e3a891214621a2fb0daf7007b3cefb02de539b7cf22ed45b6178cca7c6'
AND (
token = 'scju6znwE7M+k9rfe4zuvVx1ISF5g5663hF89rD8n0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)