UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7I9Fw3e9q8bQWy+txeYZrpNLuWVlmtvoQ28tWe53H2k=' 
WHERE 
  key_id = '805f1b6072db4d6bd6ced4e333e9dc0bf2498a2ce3f4e433b695b2ffa3bfeba8' 
  AND (
    token = '7I9Fw3e9q8bQWy+txeYZrpNLuWVlmtvoQ28tWe53H2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025