UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yfei/RTHJmuLz78onJHq0Ie6AU1gr95QpYNshmQb6aE=' 
WHERE 
  key_id = 'f086d49fbc14947c48e5bb628c66eadbf8426d21e42728d2bf2ee0aa4086f8ca' 
  AND (
    token = 'Yfei/RTHJmuLz78onJHq0Ie6AU1gr95QpYNshmQb6aE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036