UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pmNcYO1Gw2/KWiycriKSGl7WuPXWnX4WxcOcXoMMQy4=' 
WHERE 
  key_id = '08c4b9e4e223d294161324b1808032e06860d65a04992094798b158e33b5a991' 
  AND (
    token = 'pmNcYO1Gw2/KWiycriKSGl7WuPXWnX4WxcOcXoMMQy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039