UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5WffO+t3c9tXwM2ZUgWNmwvtUh/Pm+u/zCp4/AWLYcg=' 
WHERE 
  key_id = '2ca684556e267ed43da20b26ae3bca8ea52eda5f8a658a734abdf45e24f7704b' 
  AND (
    token = '5WffO+t3c9tXwM2ZUgWNmwvtUh/Pm+u/zCp4/AWLYcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058