UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '41+GxKfxV9rx3mbpQV/d+lIUxb5CF3XelnLEnYezPP0=' 
WHERE 
  key_id = '633c4bc816fb05dbf7b946877e68928e48ed8dd7ae8aa276aed4449aa1ed2bbd' 
  AND (
    token = '41+GxKfxV9rx3mbpQV/d+lIUxb5CF3XelnLEnYezPP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025