UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qsvIjk5KD4xr0dyDeLZBENlFXpZUq1O2SkN7Di3G5+M='
WHERE
key_id = '4600abb0c95fc6f6c187c5db7c098bffdb7c66ebe2fb22719dcdc18ac74c3c12'
AND (
token = 'qsvIjk5KD4xr0dyDeLZBENlFXpZUq1O2SkN7Di3G5+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)