UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGdaAlasDxA90YzUNmyzT3l6LtVKODLlLQpkNqVxxP8='
WHERE
key_id = '820676a1ceacabb027ffa8a075b6dbb6011198bcc07c8c6f024cb4314e446e4f'
AND (
token = 'oGdaAlasDxA90YzUNmyzT3l6LtVKODLlLQpkNqVxxP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)