UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Rb2mByJ+RKIzoIzwjXuCiRROdgRpq9xR9LireG0mKg=' 
WHERE 
  key_id = '2ef78c8661f17a83ecfa23846c0d1995a2fcf23dc44950613677c8f2452f2aa6' 
  AND (
    token = '1Rb2mByJ+RKIzoIzwjXuCiRROdgRpq9xR9LireG0mKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00152